﻿<script src ="scripts/busOrder.js?v=1.6"></script>
<script src ="scripts/httpService.js?v=1.4"></script>
<script src ="scripts/datepicker.js"></script>
<script src ="scripts/utility.js?v=1.3"></script>
<script src="js/xg_js.js"></script>
<script>
    createMenu(1);
    $('.datepicker').datepicker({
        language: 'zh-CN',
        autoclose: true,
        todayHighlight: true
    });
</script>
<div class="pageheader">
    <h2><i class="fa fa-hand-o-up"></i> 假期班车管理 <span>车次管理</span></h2>
</div>

<div class="contentpanel" ng-app="busOrderApp" ng-controller="busOrderCtrl">
    <div class="row xg-content">
        <div class="col-xs-12">

            <div class="btn-group">
                <button type="button" class="btn btn-warning" ng-click="refreshBusOrder()">
                    <span class="glyphicon glyphicon-refresh"></span> 刷新
                </button>
                <!--<button type="button" class="btn btn-primary" ng-click="addBusOrder()">-->
                <button type="button" class="btn btn-primary" ng-click="addBusOrder()">
                    <span class="glyphicon glyphicon-pencil"></span> 添加
                </button>
                <button type="button" class="btn btn-success" ng-click="updateBusOrder()">
                    <span class="glyphicon glyphicon-send"></span> 更新
                </button>
                <button type="button" class="btn btn-danger" ng-click="deleteBusOrder()">
                    <span class="glyphicon glyphicon-trash"></span> 删除
                </button>

            </div>
            <table class="table table-striped table-hover">
                <tr>
                    <th>选择</th>
                    <th>ID</th>
                    <th>方向</th>
                    <th>出发时间</th>
                    <th>生效时间</th>
                    <th>截至加车时间</th>
                    <th>车辆数</th>
                    <th>座位总数</th>
                    <th>已定座数</th>
                    <th>添加时间</th>
                    <th>备注</th>
                </tr>
                <tr ng-repeat="busOrder in busOrders" ng-click="selectChange($index)">
                    <td>
                        <input type="checkbox" ng-model="busOrder.checked" />
                    </td>
                    <td ng-bind="busOrder.id"></td>
                    <td ng-if="busOrder.orientation==0">成都方向</td>
                    <td ng-if="busOrder.orientation==1">基地方向</td>
                    <td ng-bind="busOrder.departuredate"></td>
                    <td ng-bind="busOrder.validitydate"></td>
                    <td ng-bind="busOrder.endbusdate"></td>
                    <td ng-bind="busOrder.busescount"></td>
                    <td ng-bind="busOrder.seatscount"></td>
                    <td ng-bind="busOrder.occupation"></td>
                    <td ng-bind="busOrder.adddate"></td>
                    <td ng-bind="busOrder.other"></td>
                </tr>
            </table>
        </div>
    </div>
<!-- end contentpanel-->

<!-- 模态框内容 -->
    <script type="text/ng-template" id="modifyBusOrder">
        <div class='modal-content'  >
        <div class='modal-header'>
        <button type='button' class='close' data-dismiss='modal' ng-click="close()" >&times;</button>
        <h2 class='modal-title' style="padding-left:40%">车次信息</h2>
        </div>

        <div class='modal-body '>
        <form class='form-horizontal' role='form'>
        <div class="panel panel-info">
        <div class="panel-heading">
        <h3 class="panel-title">
                   班车次基本信息
        </h3>
        </div>
        <div class="panel-body">
        <div class='form-group '>
        <div class="col-sm-2 ">
                    <label class='control-label' style="float:right" >发车方向</label>
       </div>
        <div class='col-sm-4'>
        <select class="form-control" ng-disabled="isEabled" ng-options="oritention.id as oritention.name for oritention in oritentions" ng-model="busOrder.orientation">
        </select>
        </div>        
        </div>
      <div class='form-group '>
       <div class="col-sm-2 ">
       <label class='control-label' style="float:right">发车时间</label>
        </div>
        <div class='col-sm-10'>
      <input type="text" id="date" class='form-control date' ng-model="busOrder.departuredate"/>   
       </div> 
       </div>
      <div class='form-group '>
       <div class="col-sm-2 ">
       <label class='control-label' style="float:right">生效时间</label>
        </div>
        <div class='col-sm-10'>
      <input type="text" id="date" class='form-control date' ng-model="busOrder.validitydate"/>   
       </div> 
       </div>
    <div class='form-group '>
        <div class="col-sm-2 ">
        <label class='control-label' style="float:right">自增截至</label>
        </div>
        <div class='col-sm-10'>
       <input type="text" id="date" class='form-control date' ng-model="busOrder.endbusdate"/>   
        </div> 
    
        </div>
         <div class='form-group '>
        <div class="col-sm-2 ">
        <label class='control-label' style="float:right">其他</label>
        </div>
        <div class='col-sm-10'>
       <input type="text" class='form-control date' ng-model="busOrder.other" placeholder='其他信息'/>
       
       </div>        
        </div>
       
        </div>
        </div>
        
        <div class="alert alert-info" ng-show="loading || submitted">
            <span  ng-show='loading' > <i class="fa fa-spinner"></i></span>
            <span ng-show='submitted'>{{result}}</span>
        </div>
        
        <div class='modal-footer'>
        <button type='button' class='btn btn-default' id="modalCloseBtn" data-dismiss='modal' ng-click="close()">取消</button>
        <button id="submitParkBtn" type='button'ng-click="submit()" class='btn btn-primary'>确定</button>
        </div>
        
        </div>
   </script>
</script>

</div>